<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" type="text/css" href="../../css/style.css" />
<link rel="stylesheet" type="text/css" href="../../css/demo.css" />
<script src="../../js/demo.js" type="text/javascript" charset="utf-8"></script>
<title>店铺管理</title>
</head>
<body>
	<!--header-->
	<div class="header">
		<div class="header-content">
			<ul class="nav left">
				<li><img src="../../img/regist-arrow.png" /></li>
				<li class="nav-one"><a href="javascript:history.go(-1);">返回</a></li>
				<li class="nav-two"><a href="../../">关闭</a></li>
			</ul>
			<p class="left">商品管理</p>
			<div class="right nav_right">
				<img src="../../img/regist-list.png" />
			</div>
		</div>
	</div>
	<!--main-->
	<div class="main clear">
		<div class="shopmanagement">
			<div class="shopmanagement-search">
				<img src="../../img/shopmanagement-icon12.png" class="left" />
				<div class="shopmanage-search-M left">
						<form action="" >
							<label for="search">
								<select style="height: 40px; background-color: #EFEFF0; border: none; font-size: 25px;">
									<option id="o1" value="1">店铺</option>
									<option id="o2" value="2">商品</option>
								</select> 
							    <img src="../../img/shopmanagement-icon13.png"/>
							</label>
						    <input type="text" name="search" id="" value="" placeholder="请输入关键词搜索"/>	
							<img src="../../img/shopmanagement-icon9.png" onclick="search1()"/> 
						</form>
					</div>

				<img src="../../img/shopmanage.png" class="right" />
			</div>
			<div class="shopmanage-center">
				<img src="../../imgs/shopmanagement-icon7.png"
					class="shopmanagement-icon7 clear left" id="i1" />
				<div class="shopmanage-text left">
					<p id="p1">店铺名称00001</p>
					<p id="p2">域名：shop003.qiaofree.com</p>
				</div>
			</div>

		</div>
		<div class="shopmanage-seticon">
			<ul class="shopmanage-seticonlist">
				<li style="text-align: left;"><img
					src="../../img/shopmanagement4-icon6.png" />店铺设置</li>
				<li style="text-align: center;"><img
					src="../../img/shopmanagement-icon5.png" />店铺二维码</li>
				<li style="text-align: right;"><img
					src="../../img/shopmanagement4-icon4.png" />分享店铺</li>
			</ul>
		</div>
		<div class="shopmanage-pro">
			<ul class="shopmanage-prolist">
				<li><select onchange="getStatus2()"
					style="height: 50px; background-color: #EFEFF0; border: none; font-size: 25px; color: red;">
						<option id="o1" selected="selected" value="1">销售中</option>
						<option id="o2" value="2">待售</option>
				</select></li>
				<li><select onchange="selectGoodByOrder()"
					style="height: 50px; background-color: #EFEFF0; border: none; font-size: 25px; color: red;">
						<option value="1">最新排序</option>
						<option value="2">按销量排序</option>
						<option value="3">按佣金排序</option>
						<option value="4">按售价排序</option>
						<option value="5">按收藏排序</option>
				</select></li>
				<li>筛选<img src="../../img/shopmanagement-icon3.png" alt="" /></li>
			</ul>
			<img src="../../img/shopmanage-line.png" class="shopmanage-line" /> <img
				src="../../img/shopmanage-line.png" class="shopmanage-line2" />
			<div class="shopmanage-line3">
				<img src="../../img/shopmanage-line2.png" />
			</div>

			<div class="shopmanage-list" id="d0">
				<img src="../../imgs/shopmanagement-icon.jpg" />
				<ul class="shopmanage-listes left">
					<li class="shopmanage-one">KUYURA美肌护手霜（天然果香型） <span
						style="display: block; margin-top: 0.12rem;">150ml（韩国直送）</span>
					</li>
					<li class="shopmanage-two">￥56.00<span>佣金：</span><span>￥2.65</span></li>
					<li class="shopmanage-thr">剩余<span>1799</span><span
						style="margin-right: 0.05rem;">件</span> 销量<span
						style="margin-right: 0.1rem;">645</span> 收藏<span>334</span></li>
				</ul>
			</div>

			<div class="shopmanage-line3">
				<img src="../../img/shopmanage-line2.png" />
			</div>

			<div class="shopmanage-list" id="d1">
				<img src="../../imgs/shopmanagement-icon.jpg" />
				<ul class="shopmanage-listes left">
					<li class="shopmanage-one">KUYURA美肌护手霜（天然果香型） <span
						style="display: block; margin-top: 0.12rem;">150ml（韩国直送）</span>
					</li>
					<li class="shopmanage-two">￥56.00<span>佣金：</span><span>￥2.65</span></li>
					<li class="shopmanage-thr">剩余<span>1799</span><span
						style="margin-right: 0.05rem;">件</span> 销量<span
						style="margin-right: 0.1rem;">645</span> 收藏<span>334</span></li>
				</ul>
			</div>

			<div class="shopmanage-line3">
				<img src="../../img/shopmanage-line2.png" />
			</div>

			<div class="shopmanage-list" id="d2">
				<img src="../../imgs/shopmanagement-icon.jpg" />
				<ul class="shopmanage-listes left">
					<li class="shopmanage-one">KUYURA美肌护手霜（天然果香型） <span
						style="display: block; margin-top: 0.12rem;">150ml（韩国直送）</span>
					</li>
					<li class="shopmanage-two">￥56.00<span>佣金：</span><span>￥2.65</span></li>
					<li class="shopmanage-thr">剩余<span>1799</span><span
						style="margin-right: 0.05rem;">件 </span> 销量<span
						style="margin-right: 0.1rem;">645</span> 收藏<span>334</span></li>
				</ul>
			</div>
			<div class="shopmanage-line3">
				<img src="../../img/shopmanage-line2.png" />
			</div>
		</div>
		<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
		<script type="text/javascript">
			showHtml();
			function showHtml() {
				$.ajax({
					type : "POST",
					url : "/qiaomengapp/shop/showHtml",
					dataType : "json",
					success : function(data) {
						$('#i1').attr('src', data.shopTitleurl);
						$('#p1').html(data.shopName);
						$('#p2').html(data.shopIp);
					}
				});
			}
			showHtml2();
			function showHtml2() {
				$
						.ajax({
							type : "POST",
							url : "/qiaomengapp/shopGood/manageGood",
							dataType : "json",
							success : function(data) {
								for (var i = 0; i < data.length; i++) {
									$(eval("d" + i))
											.html(
													"<img src='"+data[i].goodImgurl+"'/>"
															+ "<ul class='shopmanage-listes left'>"
															+ "<li class='shopmanage-one'>"
															+ data[i].goodDesc
															+ "</li>"
															+ "<li class='shopmanage-two'>￥"
															+ data[i].price
															+ "<span>佣金：</span><span>￥"
															+ data[i].commission
															+ "</span></li>"
															+ "<li class='shopmanage-thr'>剩余<span>"
															+ data[i].sum
															+ "</span><span"
													+"style='margin-right: 0.05rem;'>件</span> 销量<span"
													+"style='margin-right: 0.1rem;'>"
															+ data[i].salesCount
															+ "</span> 收藏<span>"
															+ data[i].focusNum
															+ "</span></li></ul>	");
								}
							}
						});

			}
			
			//按照不同的条件显示不同的数据
			function selectGoodByOrder() {
				var $option = $(event.target);
				if ($option.val() == 1) {
					showHtml2();
				} else if ($option.val() == 2) {
					$
							.ajax({
								type : "post",
								url : "/qiaomengapp/shopGood/select_ShopGoodBySaleCount",
								dataType : "json",
								success : function(data) {
									for (var i = 0; i < data.length; i++) {
										$(eval("d" + i))
												.html(
														"<img src='"+data[i].goodImgurl+"'/>"
																+ "<ul class='shopmanage-listes left'>"
																+ "<li class='shopmanage-one'>"
																+ data[i].goodDesc
																+ "</li>"
																+ "<li class='shopmanage-two'>￥"
																+ data[i].price
																+ "<span>佣金：</span><span>￥"
																+ data[i].commission
																+ "</span></li>"
																+ "<li class='shopmanage-thr'>剩余<span>"
																+ data[i].sum
																+ "</span><span"
											+"style='margin-right: 0.05rem;'>件</span> 销量<span"
											+"style='margin-right: 0.1rem;'>"
																+ data[i].salesCount
																+ "</span> 收藏<span>"
																+ data[i].focusNum
																+ "</span></li></ul>	")
									}
								}
							});
				} else if ($option.val() == 3) {
					$
							.ajax({
								type : "post",
								url : "/qiaomengapp/shopGood/select_ShopGoodByCommission",
								dataType : "json",
								success : function(data) {
									for (var i = 0; i < data.length; i++) {
										$(eval("d" + i))
												.html(
														"<img src='"+data[i].goodImgurl+"'/>"
																+ "<ul class='shopmanage-listes left'>"
																+ "<li class='shopmanage-one'>"
																+ data[i].goodDesc
																+ "</li>"
																+ "<li class='shopmanage-two'>￥"
																+ data[i].price
																+ "<span>佣金：</span><span>￥"
																+ data[i].commission
																+ "</span></li>"
																+ "<li class='shopmanage-thr'>剩余<span>"
																+ data[i].sum
																+ "</span><span"
											+"style='margin-right: 0.05rem;'>件</span> 销量<span"
											+"style='margin-right: 0.1rem;'>"
																+ data[i].salesCount
																+ "</span> 收藏<span>"
																+ data[i].focusNum
																+ "</span></li></ul>	")
									}
								}
							});
				} else if ($option.val() == 4) {
					$
							.ajax({
								type : "post",
								url : "/qiaomengapp/shopGood/select_ShopGoodByPrice",
								dataType : "json",
								success : function(data) {
									for (var i = 0; i < data.length; i++) {
										$(eval("d" + i))
												.html(
														"<img src='"+data[i].goodImgurl+"'/>"
																+ "<ul class='shopmanage-listes left'>"
																+ "<li class='shopmanage-one'>"
																+ data[i].goodDesc
																+ "</li>"
																+ "<li class='shopmanage-two'>￥"
																+ data[i].price
																+ "<span>佣金：</span><span>￥"
																+ data[i].commission
																+ "</span></li>"
																+ "<li class='shopmanage-thr'>剩余<span>"
																+ data[i].sum
																+ "</span><span"
							+"style='margin-right: 0.05rem;'>件</span> 销量<span"
							+"style='margin-right: 0.1rem;'>"
																+ data[i].salesCount
																+ "</span> 收藏<span>"
																+ data[i].focusNum
																+ "</span></li></ul>	")
									}
								}
							});
				} else {
					$
							.ajax({
								type : "post",
								url : "/qiaomengapp/shopGood/select_ShopGoodByfocus_num",
								dataType : "json",
								success : function(data) {
									for (var i = 0; i < data.length; i++) {
										$(eval("d" + i))
												.html(
														"<img src='"+data[i].goodImgurl+"'/>"
																+ "<ul class='shopmanage-listes left'>"
																+ "<li class='shopmanage-one'>"
																+ data[i].goodDesc
																+ "</li>"
																+ "<li class='shopmanage-two'>￥"
																+ data[i].price
																+ "<span>佣金：</span><span>￥"
																+ data[i].commission
																+ "</span></li>"
																+ "<li class='shopmanage-thr'>剩余<span>"
																+ data[i].sum
																+ "</span><span"
								+"style='margin-right: 0.05rem;'>件</span> 销量<span"
								+"style='margin-right: 0.1rem;'>"
																+ data[i].salesCount
																+ "</span> 收藏<span>"
																+ data[i].focusNum
																+ "</span></li></ul>	")
									}
								}
							});
				}
			}
			
			
			//显示未销售的商品
			function getStatus2(){
				var $option=$(event.target);
				if($option.val()==1){
					showHtml2();
				}else{
				$
				.ajax({
					type : "post",
					url : "/qiaomengapp/shopGood/manageGood1",
					dataType : "json",
					success : function(data) {
						$('.shopmanage-list').html("");
						for (var i = 0; i < data.length; i++) {
							$(eval("d" + i))
									.html(
											"<img src='"+data[i].goodImgurl+"'/>"
													+ "<ul class='shopmanage-listes left'>"
													+ "<li class='shopmanage-one'>"
													+ data[i].goodDesc
													+ "</li>"
													+ "<li class='shopmanage-two'>￥"
													+ data[i].price
													+ "<span>佣金：</span><span>￥"
													+ data[i].commission
													+ "</span></li>"
													+ "<li class='shopmanage-thr'>剩余<span>"
													+ data[i].sum
													+ "</span><span"
											+"style='margin-right: 0.05rem;'>件</span> 销量<span"
											+"style='margin-right: 0.1rem;'>"
													+ data[i].salesCount
													+ "</span> 收藏<span>"
													+ data[i].focusNum
													+ "</span></li></ul>	")
						}
					}
				});}
			}
			//模糊查询的点击事件使用   location来  定位请求地址以及传递参数
			function search1(){
				var $img=$(event.target);
				var $input = $img.siblings("input");
				var dataStr=$input.val();
				location="/qiaomengapp/html/product/product-search.html?"+dataStr;
			}
			
		</script>
	</div>
</body>
</html>